package com.hxx.sbcommon.common.io.http.config;

import org.apache.http.Consts;
import org.apache.http.entity.ContentType;

public class HttpClientConstants {

    public static final String CONTENT_VALUE_FORM_DATA = "multipart/form-data";
    public static final String CONTENT_VALUE_FORM = "application/x-www-form-urlencoded";
    public static final String CONTENT_VALUE_JSON = "application/json";

    /**
     * 默认字符集 utf-8
     */
    public static final String DEFAULT_CHAR_SET = "UTF-8";

    // 指定与远程主机建立连接的超时时间
    public static final int DEFAULT_CONNECTION_TIMEOUT = 10000;
    // 指定建立连接后等待数据的超时时间
    public static final int DEFAULT_SOCKET_TIMEOUT = 10000;
    // 指定从连接池获取连接的超时时间
    public static final int DEFAULT_CONNECTION_REQUEST_TIMEOUT = 60000;

    public static final int maxConnectionSize = 500;
    public static final int maxPerRouteSize = 500;
    public static final int maxIdleSecond = 60;

    // 常用内容类型
    // Content-Type: text/plain; charset=UTF-8
    public static final ContentType TEXT_PLAIN_UTF_8 = ContentType.create("text/plain", Consts.UTF_8);
    public static final ContentType URL_ENCODED_UTF_8 = ContentType.create(CONTENT_VALUE_FORM, Consts.UTF_8);
    public static final ContentType JSON_UTF_8 = ContentType.create(CONTENT_VALUE_JSON, Consts.UTF_8);

}
